﻿@model Dexter.Web.Mvc.ViewModel.Backoffice.ViewsData.AccountController.AccountIndexViewData
@using System.Web.Security
@{
	ViewBag.Title = "Index";
	Layout = "~/Areas/Admin/Views/Shared/_BackOffice.cshtml";
}

<section class="grid_12">
	<div class="block-border">
		<form class="block-content form" id="table_form" method="post" action="">
			<h1>Users</h1>
				
			<div class="block-controls">
				@Html.RenderBackOffice( Model.Users.PageSize, Model.Users.PageIndex, Model.Users.TotalCount, HttpContext.Current.Request.Url.ToString ( ).ToLowerInvariant ( ).Contains ( "page" ) ? HttpContext.Current.Request.Url.ToString ( ) : HttpContext.Current.Request.Url + "/Index" )
			</div>

			<div class="no-margin">
				<table class="table" cellspacing="0" width="100%">
					<thead>
						<tr>
							<th class="col">Username</th>
							<th scope="col">Email</th>
							<th scope="col">Is Locked</th>
							<th scope="col">Is Approved</th>
							<th scope="col">Last Login Date</th>
							<th scope="col" class="table-actions">Actions</th>
						</tr>
					</thead>
					@foreach (MembershipUser user in Model.Users.Result) {
							<tr>
								<td><strong>@user.UserName</strong></td>
								<td><a href="mailto:@user.Email">@user.Email</a></td>
								<td>@user.IsLockedOut</td>
								<td>@user.IsApproved</td>
								<td>@user.LastLoginDate</td>
								<td class="table-actions">
									<a href="@U.User.ChangePermissions( user.UserName )" title="Change Roles" class="with-tip"><img src="@Url.Content( "~/admin/Resources/images/Icons/Fugue/user-silhouette-question.png" )" width="16" height="16" alt="Change Password" /></a>
									<a href="@U.User.ChangeUserPassword(user.UserName)" title="Change Password" class="with-tip"><img src="@Url.Content( "~/admin/Resources/images/Icons/Fugue/address-book.png" )" width="16" height="16" alt="Change Password" /></a>
									<a href="@U.User.DeleteUser( user.UserName )" title="Delete" class="with-tip"><img src="@Url.Content( "~/admin/Resources/images/Icons/Fugue/cross-circle.png" )" width="16" height="16" alt="Delete User" /></a>
								</td>
							</tr>
					}
				</table>
			</div>
		
		</form>
	</div>
</section>